package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.TextalipayMapper;
import com.education.wisdom.pojo.Textalipay;
import com.education.wisdom.service.ITextalipayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 测试支付宝支付 服务层实现
 * 
 * @author ruoyi
 * @date 2019-01-25
 */
@Service
public class TextalipayServiceImpl implements ITextalipayService
{
	@Autowired
	private TextalipayMapper textalipayMapper;

	/**
     * 查询测试支付宝支付信息
     * 
     * @param orderId 测试支付宝支付ID
     * @return 测试支付宝支付信息
     */
    @Override
	public Textalipay selectTextalipayById(Integer orderId)
	{
	    return textalipayMapper.selectTextalipayById(orderId);
	}
	
	/**
     * 查询测试支付宝支付列表
     * 
     * @param textalipay 测试支付宝支付信息
     * @return 测试支付宝支付集合
     */
	@Override
	public List<Textalipay> selectTextalipayList(Textalipay textalipay)
	{
	    return textalipayMapper.selectTextalipayList(textalipay);
	}
	
    /**
     * 新增测试支付宝支付
     * 
     * @param textalipay 测试支付宝支付信息
     * @return 结果
     */
	@Override
	public int insertTextalipay(Textalipay textalipay)
	{
		textalipay.setCreateTime(new Date());
		textalipay.setOrderStatus("1");
	    return textalipayMapper.insertTextalipay(textalipay);
	}
	
	/**
     * 修改测试支付宝支付
     * 
     * @param textalipay 测试支付宝支付信息
     * @return 结果
     */
	@Override
	public int updateTextalipay(Textalipay textalipay)
	{

	    return textalipayMapper.updateTextalipay(textalipay);
	}

	/**
     * 删除测试支付宝支付对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteTextalipayByIds(String ids)
	{
		return textalipayMapper.deleteTextalipayByIds(Convert.toStrArray(ids));
	}
	
}
